package player;

import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.image.ImageObserver;

public class Hero {
	private Graphics mGraphics;
	private ImageObserver mImageObserver;
	
	private int mHealth = 100;
	private int mAnchorX = 0;
	private int mAnchorY = 0;
	private Image mImg = null;
	private String mHeroName = null;
	
	public Hero(String heroName) {
		mHeroName = heroName;
		mImg = Toolkit.getDefaultToolkit().getImage(
					Hero.class.getClassLoader().getResource("res/HeroImgs/" + mHeroName +".png"));
	}
	public Hero(String heroName, Graphics g, ImageObserver obs) {
		mGraphics = g;
		mImageObserver = obs;
		mHeroName = heroName;
		mImg = Toolkit.getDefaultToolkit().getImage(
					Hero.class.getClassLoader().getResource("res/HeroImgs/" + mHeroName +".png"));
	}
	
	public void draw(){
		mGraphics.drawImage(mImg, mAnchorX, mAnchorY, mImageObserver);
	}
	public void draw(Graphics g, ImageObserver observer){
		g.drawImage(mImg, mAnchorX, mAnchorY, observer);
	}
	
	public void duang(String duang){
		
	}
	
	public int getHealth() {
		return mHealth;
	}
	public void setHealth(int health) {
		mHealth = health;
	}
	public void setAnchor(int x, int y){
		mAnchorX = x;
		mAnchorY = y;
	}
	public int getAnchorX() {
		return mAnchorX;
	}
	public void setAnchorX(int x) {
		mAnchorX = x;
	}
	public int getAnchorY() {
		return mAnchorY;
	}
	public void setAnchorY(int y) {
		mAnchorY = y;
	}
	public Image getImg() {
		return mImg;
	}
	public void setImg(Image img) {
		mImg = img;
	}
	public String getHeroName() {
		return mHeroName;
	}
	public void setHeroName(String heroName) {
		mHeroName = heroName;
	}
}
